home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_a.xml next >
Encoding:
Extensible Markup Language  |  2004-07-02  |  6.4 KB  |  115 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="565" height="350" caption="Hyperlink">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" width="565" height="177" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <label caption="Description" hint="Enter a description for the link. This description will be the visible part of the link, the part that the user can click." name="Label8" width="66" height="13" top="10" left="280"/>
  6.             <label caption="ALT text (title)" hint="Enter an alternative text for the link, which will be shown when the cursor hovers over the link." name="Label9" width="88" height="13" top="50" left="8"/>
  7.             <label caption="Address (URL)" hint="Enter an address (URL) for the link to point to." name="Label10" width="82" height="13" top="10" left="8"/>
  8.             <speedbutton caption="" glyph="icons\16x16\look_for_files.bmp" hint="Search on this computer for a document to link to." name="FlatSpeedButton2" width="19" height="19" top="24" left="246">
  9.                 <event type="onclick">
  10.                 sOpenDialog := TOpenDialog.Create(Self);
  11.                 WebExtensions := GetWebTypes();
  12.                 sOpenDialog.Filter := 'Web documents ('+WebExtensions+')|'+WebExtensions;                
  13.                 If sOpenDialog.Execute then
  14.                  edtLinkUrl.Text := sOpenDialog.FileName;
  15.                 sOpenDialog.Free;
  16.                 </event>
  17.             </speedbutton>
  18.             <label caption="Target (frame name)" hint="Specify the name of a frame where the link should be opened. Enter a destination or pick one from the list." name="Label13" width="102" height="13" top="90" left="8"/>
  19.             <label caption="Name" hint="Enter a "name" for the link. You can later refer to this place in the document, by using a link that points to #thisname." name="Label11" width="29" height="13" top="130" left="8"/>
  20.             <edit taborder="0" text="" hint="Enter an address (URL) for the link to point to." name="edtLinkUrl" width="234" height="19" top="24" left="8"/>
  21.             <edit taborder="1" text="" hint="Enter an alternative text for the link, which will be shown when the cursor hovers over the link." name="edtlinkALT" width="258" height="19" top="64" left="8"/>
  22.             <memo taborder="4" hint="Enter a description for the link. This description will be the visible part of the link, the part that the user can click." name="mmoLinkDescription" width="258" height="100" top="24" left="280"/>
  23.             <combobox taborder="2" text="" hint="Specify the name of a frame where the link should be opened. Enter a destination or pick one from the list." name="comLinkDestination" width="257" height="21" top="104" left="8">
  24.                 <items>
  25.                 _blank
  26.                 _self
  27.                 _parent
  28.                 _top
  29.                 </items>
  30.             </combobox>
  31.             <edit taborder="3" text="" hint="Enter a "name" for the link. You can later refer to this place in the document, by using a link that points to #thisname." name="edtLinkName" width="257" height="19" top="144" left="8"/>
  32.         </panel>
  33.     </controls>
  34.     <dialogevents>
  35.         <event type="onclose" resulttype="ok">
  36.             StartCode := '<a';
  37.              if edtLinkUrl.Text <> '' then
  38.              StartCode := StartCode + ' href="'+(edtLinkUrl.Text)+'"';
  39.             if edtlinkALT.Text <> '' then
  40.              StartCode := StartCode + (' title="'+(edtlinkALT.Text)+'"');
  41.              if comLinkDestination.Text <> '' then
  42.                StartCode := StartCode + (' target="'+(comLinkDestination.Text)+'"');
  43.              if edtLinkName.Text <> '' then
  44.                StartCode := StartCode + (' name="'+(edtLinkName.Text)+'"');
  45.               
  46.               If edtCSSClass.Text <> '' then
  47.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  48.               If edtCSSId.Text <> '' then
  49.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  50.               If edtCSSStyle.Text <> '' then
  51.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  52.  
  53.             for i := 0 to EventGrid.Count - 1 do
  54.               begin
  55.               if EventGrid.Rows[i].EditText <> '' then
  56.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  57.              end;  
  58.             StartCode := StartCode + '>';
  59.             EndCode := mmoLinkDescription.Text+'</a>';
  60.             If cbMakeXHTMLCompliant.Checked then
  61.              StartCode := MakeXHTMLCompliant(StartCode, true);             
  62.             If cbDoPHPEscape.Checked then
  63.              StartCode := DoPHPEscape(StartCode);
  64.             // A little "hack" - WebCoder will set this, to let us know whether to update
  65.             // an existing tag, or insert a brand new one
  66.             If cbUpdateExistingTag.Checked then 
  67.              ReplaceTag(StartCode+EndCode)
  68.             else
  69.              If Editor.SelText <> '' then
  70.               Editor.SelText := StartCode+EndCode
  71.              else 
  72.                 InsertTags(StartCode, EndCode);    
  73.               
  74.         </event>
  75.         <event type="onshow">    
  76.             If (Editor.SelText <> '') AND (cbUpdateExistingTag.Checked = false) then
  77.              mmoLinkDescription.Text := Editor.SelText;    
  78.             // Lets put the advanced panel in the right place
  79.             pnlAdvanced.Parent := MainPanel;
  80.             pnlAdvanced.Left := 8;
  81.             pnlAdvanced.Top := MainPanel.Height - 32;        
  82.             pnlAdvanced.Width := Self.Width - 36;
  83.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  84.             If pnlAdvanced.Height > 20 then
  85.              Self.Height := Self.Height + 200;
  86.             Self.ActiveControl := MainPanel;
  87.             MainPanel.SetFocus; 
  88.         </event>
  89.         <event type="updatedialog">
  90.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  91.             // The entire selected tag will be passed as a parameter to this function, that should update
  92.             // the required fields of the dialog.
  93.             function UpdateDialog(Tag: string);
  94.              begin
  95.               edtLinkUrl.Text := GetValueFromAttribute(Tag, 'href');
  96.               edtlinkALT.Text := GetValueFromAttribute(Tag, 'title');
  97.                comLinkDestination.Text := GetValueFromAttribute(Tag, 'target');
  98.                edtLinkName.Text := GetValueFromAttribute(Tag, 'name');
  99.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  100.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  101.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  102.               mmoLinkDescription.Text := GetValueFromTag(Tag);              
  103.               for i := 0 to EventGrid.Count - 1 do
  104.                 begin
  105.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  106.                  If EventVal <> '' then
  107.                   EventGrid.Rows[i].EditText := EventVal;
  108.                end;      
  109.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  110.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                        
  111.              end;
  112.         </event>
  113.     </dialogevents>
  114. </dialog>
  115.